<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>小小论坛</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="fly,layui,前端社区">
<meta name="description"
	content="">
<link rel="stylesheet" th:href="@{/asserts/css/layui.css}">
<link rel="stylesheet" th:href="@{/asserts/css/global.css}">
<!-- <script src="res/layui/layui.js"></script> -->
<!-- <script src="js/jquery.js"></script> -->
<style type="text/css" rel="stylesheet">
form {
	margin: 0;
}

.editor {
	margin-top: 5px;
	margin-bottom: 5px;
}
</style>

</head>
<body>
	<div th:insert="head::copy" scrolling="no" width="100%" height="65px" ></div>
	<iframe scrolling="no" width="100%" height="63px" ></iframe>

	<div class="main layui-clear">
		<div class="wrap">
			<div class="content detail">
				<div class="fly-panel detail-box">
					<h1 th:text="${data.title }"></h1>
					<div class="detail-about">
						<div class="jie-user">
							<img th:src="@{/asserts/images/uer.jpg}" alt="头像" />
								<cite>[[${data.user.username }]]<em>[[${data.dtime }]]发布</em> </cite>
						</div>
						<div class="detail-hits" data-id="{{rows.id}}" th:if="${session.user.admin }">
							<span class="layui-btn layui-btn-mini jie-admin  layui-btn-danger" type="collect" data-type="add">
								<a th:href="@{/data/deleData(delId=${data.id })}">删除</a>
							</span>
						</div>
					</div>
					<div class="detail-body photos" style="margin-bottom: 20px;">
						<p th:utext="${data.dcontent }"></p>
					</div>
				</div>
				<div class="fly-panel detail-box" style="padding-top: 0;">
					<a name="comment"></a>
					<ul class="jieda photos" id="jieda" th:each="answer:${answers }">
						<li data-id="12" class="jieda-daan">
							<a name="item-121212121212"></a>
							<div class="detail-about detail-about-reply">
								<a class="jie-user">
								<img th:src="@{/asserts/images/uer.jpg}" alt="">
								<cite> 
									<i th:text="${answer.user.username}"></i>
                				</cite> </a>
								<div class="detail-hits">
<!-- 									<span>3分钟前</span> -->
								</div>
<!-- 							<i class="iconfont icon-caina" title="最佳答案"></i> -->
							</div>
							<div class="detail-body jieda-body">
								<p th:text="${answer.acontent}"></p>
							</div>
							<div class="liulan" th:text="${answer.atime}"></div>
							<div class="jieda-reply">
<!-- 									<i class="iconfont icon-zan"></i> -->
<!-- 									<em>12</em> -->
								<div class="jieda-admin" th:if="${session.user.admin }">
									<span type="del">
									<a th:href="@{/data/deleAnswer(delId=${answer.id },dId=${data.id })}" class="layui-btn layui-btn-danger layui-btn-small">删除</a></span>
								</div>
							</div>
						</li>

						<!-- <li class="fly-none">没有任何回答</li>  -->
					</ul>
					<span id="toName" th:text="${session.user.username}"></span>
					<div class="layui-form layui-form-pane">
						<form th:action="@{/data/addAnswer(dId=${data.id})}" method="post">
							<div class="layui-form-item layui-form-text">
								<div class="layui-input-block">
									<textarea id="L_content" name="acontent" required lay-verify="required" 
									placeholder="我要回复" class="layui-textarea fly-editor" style="height: 150px;">
									</textarea>
								</div>
							</div>
							<div class="layui-form-item">
								<button class="layui-btn" type="submit" id="submit_btn">提交</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>

	</div>
 <script type="text/javascript" charset="utf-8" th:src="@{/asserts/js/kindeditor.js}"></script>
  <script type="text/javascript">
    KE.show({
        id : 'L_content',
		resizeMode : 1,
        items : [
        'fontname', 'fontsize', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
        'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
        'insertunorderedlist', 'emoticons', 'image', 'link']
    });
  </script>
</body>
</html>